﻿<phone:PhoneApplicationPage 
    x:Class="Microsoft.Samples.WindowsPhoneCloud.Phone.Pages.RegisterPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DataContext="{d:DesignData ../DesignData/RegisterPageViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.Projection>
            <PlaneProjection />
        </Grid.Projection>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{StaticResource ApplicationNameString}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="register" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentGrid" Grid.Row="1" Margin="12,0,0,12">
            
            <StackPanel Orientation="Vertical" Grid.Row="1">

                <TextBlock Text="This account is not in the database." FontSize="{StaticResource PhoneFontSizeMedium}" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneForegroundBrush}" TextWrapping="Wrap" Margin="12,0,24,0"/>
                <TextBlock Text="Would you like to register it?" FontSize="{StaticResource PhoneFontSizeMedium}" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneForegroundBrush}" TextWrapping="Wrap" Margin="12,0,24,24"/>
                
                <StackPanel Orientation="Vertical">
                    <TextBlock Text="Enter your name" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5" />
                    <TextBox x:Name="UserNameTextBox" Text="{Binding UserName, Mode=TwoWay}" KeyUp="OnTextBoxKeyUp" />
                </StackPanel>

                <StackPanel Orientation="Vertical">
                    <TextBlock Text="What's your email address?" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5" />
                    <TextBox x:Name="EMailTextBox" Text="{Binding EMail, Mode=TwoWay}" KeyUp="OnTextBoxKeyUp" />
                </StackPanel>
            </StackPanel>

            <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                <Button x:Name="RegisterButton" Margin="0,12,0,0" Content="register" Click="OnRegisterButtonClick" Visibility="{Binding IsBusy, Converter={StaticResource VisibilityConverter}, ConverterParameter=true}" HorizontalAlignment="Left" VerticalAlignment="Center" Width="228" />
                <HyperlinkButton Content="Install Certificate" VerticalAlignment="Center" NavigateUri="{Binding SslCertificateUri}" TargetName="_blank" Visibility="{Binding IsSslCertificateLinkVisisble, Converter={StaticResource VisibilityConverter}}" Margin="20,20,0,25" />
            </StackPanel>            
        </Grid>
        <StackPanel Margin="12,0" Orientation="Vertical" VerticalAlignment="Bottom" Grid.Row="2">
            <TextBlock Text="Registering..." HorizontalAlignment="Left" Visibility="{Binding IsBusy, Converter={StaticResource VisibilityConverter}}" />
            <ProgressBar Height="20" IsIndeterminate="True" Visibility="{Binding IsBusy, Converter={StaticResource VisibilityConverter}}" />
        </StackPanel>
    </Grid>

</phone:PhoneApplicationPage>
